package cn.edu.scau.cmi.yangqing.factory;

/**
 * 
 * @author Dunka
 * @Time   2019年3月26日
 * @Todo   简单工厂 通过界面获取checkboxIndex生成Insurance
 */
public class InsuranceFactory {

	public static Insurance getInsuranceObj(Integer index) {
		Insurance insurance = null;
		switch (index) {
		case 0:
		    insurance = new DriverInjured();
			break;
		case 1:
			insurance = new CarInjured();
			break;
		case 2:
			insurance = new PersonInjured();
			break;
		case 3:
			insurance = new MutilAccident();
			break;
		default:
			break;
	}
		return insurance;
	}
}
